include ../deds/dedssrc
DEDSSRC := $(addprefix ../deds/, $(DEDSSRC))

include ../detk/detksrc
DETKSRC := $(addprefix ../detk/, $(DETKSRC))

include degfxsrc

OBJFILES := $(DEGFXSRC:.c=.o) $(DETKSRC:.c=.o) $(DEDSSRC:.c=.o)

CFLAGS := -O3 -W -Wall -pedantic -s -DMXDEBUG
INCLUDES := -I..

.PHONY : all clean delobj

all : libdegfx.a

libdegfx.a : $(OBJFILES)
	ar rs $@ $^

%.o : %.c
	gcc -c $(INCLUDES) $(CFLAGS) -o $@ $^

define delobj 
$(shell del $(subst /,\,$(obj)))
endef

clean :
	$(foreach obj, $(OBJFILES), $(delobj))
	-del *.a

